#ifndef  __ZeroServer_H__
#define  __ZeroServer_H__

#include <pthread.h>
#include <stdint.h>

class ZeroServer {
public:
	ZeroServer();
	~ZeroServer();
private:
	pthread_t mServerTid;
	struct zClient {
		int fd;
		uint32_t addr;
		pthread_t tid;
	} **mClient;
	int mClientNum, mClientMaxNum;
	pthread_mutex_t mClientMutex;

	void addClient(zClient *client);
	void delClient(zClient *client);
public:
	bool startServer();
	int getClientNum();

	static void* ServeClient(void *data);
	static void* Run(void* data);
};

#endif /*__ZeroServer_H__*/
